#ifndef _ROC_STATISTIC_H_
#define _ROC_STATISTIC_H_

#define ROC_LENGTH                 2000
#define INNER_STEP                 1


#define ROC_RATE_CHOICE            1     //0 means adaboost, 1 means foreback result


#define ROC_RATE_ADABOOST_PATH     "./roc_adaboost.csv"
#define ROC_RATE_FOREBACK_PATH     "./roc_fore_back.csv"

struct RocObject {
	float rate;
	int true_positive_cnt_sum;
	int true_negative_cnt_sum;
	int false_positive_cnt_sum;
	int false_negative_cnt_sum;
    //for saliency images
    int true_positive_cnt_sum_image;
	int true_negative_cnt_sum_image;
	int false_positive_cnt_sum_image;
	int false_negative_cnt_sum_image;
};


void InitRoc();
int StringAnalyse(const char **roc_rate, float step, struct RocObject *roc_object);

//for test
void PrintRoc();

void WriteRoc();


void ForeBackRocRate(float *result_fore, float *result_back, int width, int height, unsigned char *label_img_data);
void ForeBackRocRateNoSaliency(int width, int height, unsigned char *label_img_data);
void YonRocRate(float *index_float, unsigned char *cluster_map, int width, int height, unsigned char *label_img_data);
void SaliencyCountRocRate(float *index_float, int *cluster_count, unsigned char *label_img_data, int width, int height);

#endif //_ROC_STATISTIC_H_